package com.example.helloworld.controller;

import com.example.helloworld.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")
public class TestController {

    @Autowired
    private TestService testService;

    @GetMapping("sayHello")
    private String sayHello(@RequestParam String name) {
        testService.sayHello(name);

        return "OK";
    }


    @GetMapping("/index")
    public void index() {
        System.out.println("index");
    }

    @GetMapping("/test")
    public void test() {
        System.out.println("Hello World");
    }


}
